<template>
	<div class="tuanCard">
		<div class="tuanCard-wrap flex flexC flexBetween">
			<div class="tuanCard-title f1">
				 {{item.title}}
			</div>
			<div class="tuanCard-price">￥{{ getPrice(item) }}</div>
		</div>
		<div class="tuancard-tips flex flexC flexBetween">
			<div class="tuanCard-tips-title f1">{{ item.create_time }} 发布</div>
			<div class="tuanCard-tips-price">{{ getStatus(item.status)}}</div>
		</div>
		<div class="tuanCard-contrainer flex flexBetweenflexC flexBetween">
			<div class="f1">
				<div class="money">¥{{ item.order_money }}</div>
				<div class="num-text">订单金额</div>
			</div>
			<nut-divider direction="vertical" />
			<div class="f1">
				<div class="money">{{ item.order_num }}</div>
				<div class="num-text">订单数</div>
			</div>
			<nut-divider direction="vertical" />
			<div class="f1">
				<div class="money">{{ item.join_num }}</div>
				<div class="num-text">参团人数</div>
			</div>
		</div>
	</div>
</template>

<script lang="ts" setup>
import { reactive, toRefs, onBeforeMount, onMounted, ref } from 'vue'
 
//接收父组件传递第值
const props = defineProps (['item'])
const getStatus =(n:number|string)=>{
     if(n==0){
		return "已结束"
	 }
	  if(n==1){
		return "进行中"
	 }
	  if(n==-1){
		return "未开始"
	 }
}
const getPrice =(n:any)=>{
  if(n.small_price==n.big_price){
	 return n.small_price
  }
  return `${n.small_price}-${n.big_price}`;
}
</script>
<style scoped lang="scss">
.tuanCard {
	padding: 20px 30px;
	background: #fff;
	border-radius: 20px;
}
.tuanCard-wrap {
	.tuanCard-title {
		font-size: 30px;
		color: #000;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	.tuanCard-price {
		font-size: 30px;
		color: #f55726;
	}
}
.tuancard-tips {
	color: #999999;
	padding: 10px 0 0 0;
	.tuanCard-tips-title {
		font-size: 24px;
	}
	.tuanCard-tips-price {
		font-size: 24px;
	}
}
.tuanCard-contrainer {
	padding: 56px 0 10px 0;
	text-align: center;
	.nut-divider.nut-divider-vertical {
		height: 90px !important;
	}
	.money {
		color: #000000;
		font-size: 30px;
		font-weight: bold;
	}
	.num-text {
		color: #666666;
		font-size: 24px;
	}
}
</style>
